package com.sweetguy.constant;


import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class ML {
    public interface Redis {
        //
        String VCODE_PREFIX = "vcode:";
    }

    public interface MinIO {
        //
        String BUCKET_NAME = "mylesson";
        //
        String AVATAR_DIR = "avatar";
        //
        String COURSE_COVER_DIR = "course-cover";
        //
        String COURSE_SUMMERY_DIR = "course-summary";
        //
        String EPISODE_VIDEO_COVER_DIR = "episode-video-cover";
        //
        String EPISODE_VIDEO_DIR = "episode-video";
        //
        String BANNER_DIR = "banner";
    }

    public interface Banner {
        //
        String DEFAULT_BANNER = "default_banner.jpg";
    }

    public interface Order {
        //
        Integer UNPAID = 0, PAID = 1, CANCEL = 2, OTHER_STATE = 3;

        //
        Integer NO_PAY = 0, WECHAT_PAY = 1, ALI_PAY = 2, OTHER_PAY = 3;

        //
        String EXCEL_FILE_NAME = "订单统计表.xlsx", EXCEL_SHEET_NAME = "sheet001";

        static String statusFormat(Integer statusCode) {
            if (Objects.equals(statusCode, UNPAID)) return "未付款";
            if (Objects.equals(statusCode, PAID)) return "已付款";
            if (Objects.equals(statusCode, CANCEL)) return "已取消";
            if (Objects.equals(statusCode, OTHER_STATE)) return "其他";
            return "异常";
        }

        static String payTypeFormat(Integer payTypeCode) {
            if (Objects.equals(payTypeCode, NO_PAY)) return "未支付";
            if (Objects.equals(payTypeCode, WECHAT_PAY)) return "微信";
            if (Objects.equals(payTypeCode, ALI_PAY)) return "支付宝";
            if (Objects.equals(payTypeCode, OTHER_PAY)) return "其他";
            return "异常";
        }
    }

    public interface Course {
        //
        String DEFAULT_SUMMARY = "default-summary.jpg";

        //
        String DEFAULT_COVER = "default-cover.jpg";
    }

    public interface Episode {
        //
        String DEFAULT_VIDEO = "default-video.mp4";

        //
        String DEFAULT_VIDEO_COVER = "default-episode-video-cover.jpg";

        //
        String EXCEL_FILE_NAME = "视频集统计表.xlsx", EXCEL_SHEET_NAME = "sheet001";
    }

    public interface User {
        //
        Integer FEMALE = 0, MALE = 1, SECRET = 2;

        //
        String EXCEL_FILE_NAME = "用户统计表.xlsx", EXCEL_SHEET_NAME = "SHEET001";

        //
        String DEFAULT_PASSWORD = "123456789";

        //
        List<String> DEFAULT_AVATARS = Arrays.asList(
                "mouse.png", "cow.png", "tiger.png", "rabbit.png", "dragon.png", "snake.png",
                "horse.png", "sheep.png", "monkey.png", "chicken.png", "dog.png", "pig.png");

        static String genderFormat(Integer genderCode) {
            if (Objects.equals(genderCode, FEMALE)) return "女孩";
            if (Objects.equals(genderCode, MALE)) return "男孩";
            if (Objects.equals(genderCode, SECRET)) return "保密";
            return "异常";
        }
    }

    public interface OrderDetail {
        String EXCEL_FILE_NAME = "订单明细统计表.xlsx", EXCEL_SHEET_NAME = "SHEET001";
    }

    public interface Menu {
        //
        Long ROOT_ID = 0L;
    }

    public interface Seckill {
        //
        Integer NOT_START = 0, STARTED = 1, ENDED = 2;
    }
}
